/**
 * 路由模块
 */
import VueRouter from 'vue-router'
import home from './components/tabbar/HomeComponent.vue'
import member from './components/tabbar/MemberComponent.vue'
import search from './components/tabbar/SearchComponent.vue'
import shopcar from './components/tabbar/ShopCarComponent.vue'
import newList from './components/news/NewsList.vue'
import newsInfo from './components/news/NewsInfo.vue'
import photoList from './components/photo/PhotoList.vue'
import photoInfo from './components/photo/PhotoInfo.vue'
import goodsList from './components/goodslist/GoodsList.vue'
import goodsInfo from './components/goodslist/GoodsInfo.vue'
import goodsIntroduct from './components/goodslist/GoodsIntroduce.vue'
import goodsComment from './components/goodslist/GoodsComment.vue'

const router = new VueRouter({
    routes: [{
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            component: home
        },
        {
            path: '/member',
            component: member
        },
        {
            path: '/shopcar',
            component: shopcar
        },
        {
            path: '/search',
            component: search
        },
        {
            path: '/home/newlist',
            component: newList
        },
        {
            path: '/home/newsInfo/:id',
            component: newsInfo
        },
        {
            path: '/home/photolist',
            component: photoList
        },
        {
            path: '/home/photoinfo/:id',
            component: photoInfo
        },
        {
            path: '/home/goodslist',
            component: goodsList
        },
        {
            path: '/home/goodsinfo/:id',
            component: goodsInfo,
            // 指定路由的名称
            name: 'goodsInfo'
        },
        {
            path: '/home/goodsintroduce/:id',
            component: goodsIntroduct,
            name: 'goodsIntroduce'
        },
        {
            path: '/home/goodscomment/:id',
            component: goodsComment,
            name: 'goodsComment'
        }
    ],
    linkActiveClass: 'mui-active'
})

export default router